from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from Utils import router

app = FastAPI(title='新城数据经营系统', version="1.0", description="面向app，数据API接口")
# 允许访问的域名
origins = [
    "*"
]
# 后台api允许跨域
app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
app.include_router(router.router, prefix="/api")
